package com.nwpu.coursesupport.mapper;

import com.nwpu.coursesupport.entity.EvaluationOfCourseTargetEntity;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @author shun
 * @email ws2017303035@mail.nwpu.edu.cn
 * @date 2020-08-04 21:33:50
 */
@Mapper
public interface EvaluationOfCourseTargetDao {
//    @Select("")

    @Insert({"insert into evaluation_of_course_target values (null,#{courseTargetId},#{evaluationType},#{weight},null,null,null,null)"})
    @Options(keyProperty = "id", keyColumn = "id", useGeneratedKeys = true)
    Integer save(EvaluationOfCourseTargetEntity evaluationOfCourseTargetEntity);

    @Select("select * from evaluation_of_course_target where course_target_id=#{id}")
    List<EvaluationOfCourseTargetEntity> findByCourseTargetId(@Param("id") Integer id);

    @Update("delete from evaluation_of_course_target where id=#{id}")
    void deleteById(@Param("id") Integer id);
}
